home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19971216-19980424 / 000328_news@newsmaster….columbia.edu _Mon Mar 23 17:23:51 1998.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id RAA21555
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 23 Mar 1998 17:23:50 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id RAA26524
  7.     for kermit.misc@watsun; Mon, 23 Mar 1998 17:23:50 -0500 (EST)
  8. Path: news.columbia.edu!panix!news.panix.com!not-for-mail
  9. From: vilardi@panix.com (Greg Vilardi)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Help with simple script...
  12. Date: 23 Mar 1998 17:23:18 -0500
  13. Organization: Panix
  14. Lines: 68
  15. Message-ID: <6f6ncm$oku@panix3.panix.com>
  16. NNTP-Posting-Host: panix3.panix.com
  17. Summary: Trying to send a file to a port 1 line at a time.
  18. X-Newsposter: trn 4.0-test55 (26 Feb 97)
  19. Xref: news.columbia.edu comp.protocols.kermit.misc:8526
  20.  
  21. Hi everyone. I am having a problem writing a simple kermit script to take a
  22. flatfile of command records and spit them out to a remote serial device. The
  23. technical details are as follows: C-Kermit v6.0.192 SCO Unix 3.2v4.2 connected
  24. to a CX DigiBoard. The remote system is on a dedicated line, directly connected
  25. and standard RS232 connectivity is working fine.
  26.  
  27. I need to have a script that will take each line of a file, and send it out 
  28. the serial port. The script will then wait for a response from the port, and
  29. log both the command and the response to another file. If some kind person out
  30. there already has a script that does this or something very similar, could you 
  31. please e-mail it to me? Or could someone who knows more about scripting than I
  32. do please tell me what is wrong with the script below? I've spent most of the 
  33. weekend with the kermit manuals and have had no luck. I tried the FAQ too. 
  34. Suggestions to RTFM greatfully accepted if page numbers are provided. I have
  35. read chapters 17, 18 & 19  3 times already.
  36.  
  37. Many thanks to anyone who can help me on this one.
  38.  
  39.     -Greg V.
  40.  
  41. Script starts below:
  42.  
  43. ; Read file $1 one line at a time and send command to paging terminal on port
  44. ; $3. Write return messages to $2.
  45.  
  46. def UPDATE {
  47.     local \%c cmd
  48.     if < \v(argc) 4 end 1 Usage: UPDATE infile outfile device
  49.     ;set take error off
  50.     set carrier-watch off
  51.     OPEN READ \%1
  52.     if fail end 1 Can't open \%1 for reading.
  53.     open write \%2
  54.     if fail end 1 Can't open \%2 for writing.
  55.     set line \%3
  56.     if fail end 1 Cant open port \%3
  57.     set speed 9600
  58.     set input silence 2
  59.     set input timeout-action proceed
  60.     set input echo off
  61.     define \%c 0
  62.     while true {
  63.         read cmd
  64.         xif fail {
  65.             close write 
  66.             end 0 Commands processed: \%c.
  67.         }
  68.         increment \%c
  69. ;        writeln debug-log \m(cmd) \m(\%c)
  70.         output \m(cmd) \13\10
  71.         input 10 \10
  72.         xif fail {
  73.             close read
  74.             close write
  75.             end 1 Terminal did not respond.
  76.         }
  77.         writeln file \m(cmd)
  78.         writeln file \v(input)
  79.     }
  80. }
  81. log debug debug.log
  82. update termrecs termrecs.out /dev/ttya01
  83. close debug
  84. -- 
  85. Greg Vilardi, Host: Scanner Cinema East            E-mail:vilardi@panix.com
  86. USnail: 354 Indian Head Rd|In-Touch Management Systems | Home:(516)864-1310
  87. Commack, NY 11725         |Melville, NY 11747      | Work:(516)752-2701x240
  88. .sig Version 0.50(beta release)               I thought, I wrote, I posted.